package com.qingke.stockdata.mappers;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.qingke.stockdata.exception.NoResultException;
import com.qingke.stockdata.model.Stock;
import com.qingke.stockdata.model.StockData;

/**
 * Stock的DAO层接口
 * 
 * @author Joe
 *
 */
public interface StockDao {
	public Stock selectStockByCode(String code) throws NoResultException;// 根据股票码来查询股票信息

	public List<Stock> selectStockByUser(int userId) throws NoResultException;// 查询某个用户的所有股票信息

	public int addStock(Stock stock);// 添加股票

	public List<StockData> selectAllStockDetail(@Param("code") String code, @Param("limit") int limit,
			@Param("offset") int offset) throws NoResultException;// 查询股票详情

	// 添加股票详细信息
	public int addStockDetail(List<StockData> stockDatas);
	
	public int addUserStock(@Param("userId")int userId,@Param("stockId")int stockId);
}
